package featuresProcessing;

import java.util.Collection;
import java.util.HashMap;

import org.opencv.core.Mat;

import utils.Species;

/**
 * 
 * @author Luca Poddigue
 * A detector is used to extract data from leaves images. 
 *
 */
public interface Detector {

	/**
	 * Compute the descriptors for the input image.
	 * @return A matrix containing descriptors extracted from the image.
	 */
	public Mat getDescriptors(Mat image);
	
	/**
	 * Correspond to train the model used to compute the most similar leaves. The training dataset usually comes from a DB.
	 * @param setOfImages
	 */
	public void addTrainingDescriptors(Collection<Species> setOfImages);

	/**
	 * Searches the model and returns a ranking of similar leaves.
	 * @param descriptors The descriptors extracted from the query image.
	 * @return Found leaves in order of increasing distance from the query.
	 * @throws EmptyClassifierException If the model has not been trained.
	 */
	public HashMap<Integer, Float> classify(Mat descriptors) throws EmptyClassifierException;

}